#!/bin/bash
SOFTDIR="/srv/pkg/mysql"
MYSQLVERSION="5.5.59"
VERSION=$(cat /etc/centos-release|awk -F' ' '{if(NR==1) print $4}'|cut -d. -f1)
yum -y install zip unzip
[ ! -d $SOFTDIR ] && mkdir -p $SOFTDIR
cd $SOFTDIR && \
if [ "$VERSION" == "6" ];then
	wget http://soft.51yuki.cn/MySQL-devel-5.5.59-1.el6.zip
        unzip MySQL-devel-5.5.59-1.el6.zip
	rpm -e --nodeps mysql-libs
	yum -y localinstall MySQL-devel-* MySQL-shared-* 
elif [ "$VERSION" == "7" ];then
	wget http://soft.51yuki.cn/MySQL-devel-5.5.59-1.el7.zip
        unzip MySQL-devel-5.5.59-1.el7.zip
	rpm -e --nodeps mysql-libs
	yum -y localinstall MySQL-devel-* MySQL-shared-* 
else
	echo $"Usage: Your system is not Centos or RedHat."
fi

